package com.xjj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xjj.entity.School;
import com.xjj.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author sxy
 * @version 1.0
 * @date 2022/10/20 9:27
 */
@Mapper
public interface TestMapper extends BaseMapper<School> {
    @Select("select * from xjj_school")
    List<Student> findAllSchool();

    @Select("select t.*,s.name as schName from xjj_student t left join xjj_school s on s.id=t.school_id;")
    List<Student> test();

    @Select("select s.name as klaName from xjj_student t left join xjj_klass s on s.id=t.klass_id;")
    List<Student> test2();
}
